package popcorn.ticket.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import popcorn.ticket.entity.Users;
import popcorn.ticket.entity.UsersExample;

@Repository
public interface UsersMapper {
    long countByExample(UsersExample example);

    int deleteByExample(UsersExample example);

    int deleteByPrimaryKey(int userid);

    int insert(Users record);

    int insertSelective(Users record);

    List<Users> selectByExample(UsersExample example);

    Users selectByPrimaryKey(Integer userid);

    int updateByExampleSelective(@Param("record") Users record, @Param("example") UsersExample example);

    int updateByExample(@Param("record") Users record, @Param("example") UsersExample example);

    int updateByPrimaryKeySelective(Users record);

    int updateByPrimaryKey(Users record);
    
    /**
	 * 分页+模糊查询
	 * @param start
	 * @param pageSize
	 * @param keywords
	 * @return
	 */
	public List<Users> selectByPage(@Param("start")int start,@Param("pageSize")int limit,@Param("keywords")String keywords);
	/**
	 * 模糊查询得到总记录数
	 * @param keywords
	 * @return
	 */
	public int selectByPageCount(String keywords);
	/**
	 * 获取用户数量
	 * @return
	 */
	int selectUserNum();
	/**
	 * 根据用户名检索
	 * @param username
	 * @return
	 */
	Users selectByName(String username);
	/**
	 * 根据用户电话检索
	 * @param usertel
	 * @return
	 */
	Users selectByTel(String usertel);
	/**
	 * 根据用户权限检索
	 * @param userpower
	 * @return
	 */
	public List<Users> selectByPower(String userpower);
	
	
}